
#include "File.h"
#include <iostream>

int main (int argc, const char * argv[])
{
    try
    {
        mkuz::io::File f("test.txt");
        size_t size = 0;
        f.Read(0, size);
        char * buff = new char[size + 1];
        f.Read(buff, size);
        buff[size] = '\0';
        
        std::cout << buff << std::endl;
        delete[] buff;
        
        std::string str("qwerty");
        f.Write(str.c_str(), str.length(), true);
        std::cout << "OK!" << std::endl;
    }
    catch(std::exception & ex)
    {
        std::cout << "Error occured: " << ex.what();
    }
    return 0;
}